package com.saltedfish.tool.dialog;

import android.app.Activity;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.saltedfish.tool.R;

import butterknife.BindView;
import cn.droidlover.xdroidmvp.popwindow.DialogHelper;

public class UIFlagDoneDialog extends DialogHelper {

    @BindView(R.id.tvFlagTitle)
    TextView tvFlagTitle;

    @BindView(R.id.tv_flag_content)
    TextView tv_flag_content;

    @BindView(R.id.icon_close)
    ImageView icon_close;

    @BindView(R.id.iv_flag_image)
    ImageView iv_flag_image;

    public UIFlagDoneDialog(Activity context) {
        super(context, R.style.AlertDialogStyle);
        this.mContext = context;
        setFullWidthScreen();
        setGravity(Gravity.CENTER);
//        setAnimSet(R.style.popBottomPopAnim);

    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_ui_flag_done;
    }


    //0是子目标，1是flag目标
//    private int type;


    public void updateFlagDone(int type,String title) {
//        this.type = type;
        tvFlagTitle.setText(title);
        if(type == 0){
            iv_flag_image.setImageResource(R.drawable.calendar_pic_zmb);
            tv_flag_content.setText("你真棒！为完成了子目标的你感到骄傲！期待你完成Flag的那天");
        }else {
            iv_flag_image.setImageResource(R.drawable.calendar_pic_flag);
            tv_flag_content.setText("恭喜你完成了Flag，看到你变得更好，真是件令人高兴的事呢！");

        }

    }

    @Override
    protected void initView() {

        icon_close.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });


    }

    @Override
    protected void initData() {

    }

    @Override
    protected void dialogDismiss() {

    }


}
